package com.project.dao.impl;

import java.util.List;

import com.project.dao.LimitDao;
import com.project.dao.bean.Limits;

/**
 * 后台权限管理 Dao Impl
 * @author Sn
 *
 */
public class LimitDaoImpl extends BaseDaoImpl implements LimitDao 
{

	@Override
	public void update(Limits limits) throws Exception 
	{
		this.getSqlMapClient().update("updateLimit", limits);
	}

	@Override
	public void save(Limits limits) throws Exception 
	{
		this.getSqlMapClient().insert("saveLimit", limits);
	}

	@Override
	public List<Limits> getLimits() throws Exception 
	{
		List<Limits> list = this.getSqlMapClient().queryForList("getNewsLimit");
        return list;
	}

	@Override
	public void delete(Limits limits) throws Exception 
	{
		this.getSqlMapClient().update("deleteLimit", limits);
	}

	@Override
	public List<Limits> getLimits(Limits limits) throws Exception 
	{
		List<Limits> list = this.queryWithPg("queryLimitByPg", limits);
		return list;
	}

	@Override
	public Limits getLimitById(Limits limits) throws Exception 
	{
		return (Limits)this.getSqlMapClient().queryForObject("getLimitById",limits);
	}

}
